#!/bin/bash
wget -O mihomo.deb "https://mirror.ghproxy.com/https://github.com/MetaCubeX/mihomo/releases/download/v1.18.6/mihomo-linux-amd64-compatible-go120-v1.18.6.deb" 
sudo dpkg -i mihomo.deb
mkdir -p /etc/mihomo
wget -O /etc/mihomo/Country.mmdb "https://mirror.ghproxy.com/https://github.com/P3TERX/GeoLite.mmdb/releases/download/2024.07.13/GeoLite2-Country.mmdb"
systemd="[Unit]
Description=mihomo
After=network.target

[Service]
ExecStart=/usr/bin/mihomo -d /etc/mihomo

[Install]
WantedBy=multi-user.target
"
echo "$systemd" > /etc/systemd/system/mihomo.service
sudo systemctl daemon-reload
